<template>
  <div>
    <h2 v-text="msg" ref="title"></h2>
    <button @click="showDom" ref="btn">点我显示Dom</button>
    <School ref="sch"/>

  </div>
</template>

<script>
  // 引入School组件
  import School from "@/components/Student";
  // 创建App组件
  export default {
    name:'App',
    components:{
      School: School
    },
    data(){
      return{
        msg: '欢迎'
      }
    },
    methods:{
      showDom(){
        console.log(this.$refs)
        console.log(this.$refs.title) // 真是Dom元素
        console.log(this.$refs.btn) // 真是Dom元素
        console.log(this.$refs.sch) // School组件的实例对象

      }
    }
  }
</script>